#pragma once
#include <base_controller.h>

namespace Controller
{
    class AdaptorController : public BaseController
    {
    public:
        AdaptorController(std::shared_ptr<httplib::Server> &server, std::shared_ptr<Tshark::TsharkManager> &manager);

        /// @brief 获取tsharkmanager工作状态
        /// @param req
        /// @param resp
        void getWorkStatus(const httplib::Request &req, httplib::Response &resp);

        /// @brief 开始抓包
        /// @param res
        /// @param resp
        void startCapture(const httplib::Request &req, httplib::Response &resp);

        /// @brief 停止抓包
        /// @param req
        /// @param resp
        void stopCapture(const httplib::Request &req, httplib::Response &resp);

        /// @brief 停止监控网卡数据流趋势
        /// @param req
        /// @param resp
        void startMonitorAdaptersFlowTrend(const httplib::Request &req, httplib::Response &resp);

        /// @brief 停止监控网卡数据流趋势
        /// @param req
        /// @param resp
        void stopMonitorAdaptersFlowTrend(const httplib::Request &req, httplib::Response &resp);

        /// @brief 获取网卡流量监控数据
        /// @param req
        /// @param resp
        void getAdaptersFlowTrendData(const httplib::Request &req, httplib::Response &resp);
        
        /// @brief 获取网卡名称
        /// @param req 
        /// @param resp 
        void getAdaptersName(const httplib::Request& req,httplib::Response& resp);

        void registerRoute();
    };
}